﻿using System.Linq;
using Model;

namespace BusinessObject
{
    public class PerfilBO : Repository<Perfil>
    {
        #region Singleton

        private static readonly PerfilBO _instance = new PerfilBO();

        /// <summary>
        /// Instância do objeto singleton.
        /// </summary>
        public static PerfilBO Instance
        {
            get { return _instance; }
        }

        private PerfilBO() { }

        #endregion Singleton

        public Perfil getByName(string perfilName)
        {
            return (base.GetByCriteria(p => p.Nome == perfilName)).FirstOrDefault();
        }
    }
}